Kafka Data Intake Message Contract

Every Data Intake message is a Kafka record containing:

  • A string record key

  • UTF-8 Kafka headers

  • An XML record value where required

Record Key

The recommended record key is:fileId

The key is optional to the consumer, but when present it must exactly match the fileId Kafka header. A mismatch causes message processing to fail.

The key is not used as a fallback when the fileId header is missing.

Using fileId as the key ensures that all operations for one intake file are assigned to the same Kafka partition.

Supported Operations

Operation Required headers Record value
beginLoading operation, fileId, groupCustomerNumber, profileName, expectedRecordCount; independent is optional File-level fields XML
addRecord operation, fileId, groupCustomerNumber, memberId, recordGroupId, processOrder Record XML
completeLoading operation, fileId, groupCustomerNumber Empty/null
process operation, fileId, groupCustomerNumber Empty/null

Header names are case-sensitive at the Kafka transport layer. Use the exact names shown above.

Processing Sequence

Messages for a file must be published in this order:

Do not publish addRecord, completeLoading, or process before the corresponding beginLoading operation.

Operation Example Message
Example: beginLoading

Key:

FILE-10001

Headers:

operation=beginLoading

fileId=FILE-10001

groupCustomerNumber=GC-100

profileName=Enrollment

expectedRecordCount=2

independent=N

<fields>

<field NAME="ReceivedDate" TYPE="DATE">2026-09-01</field>

</fields>

Example: addRecord

Key:

FILE-10001

Headers:

operation=addRecord

fileId=FILE-10001

groupCustomerNumber=GC-100

memberId=MEMBER-001

recordGroupId=GROUP-001

processOrder=0

<Record>

<fields>

<field NAME="Source" TYPE="TEXT">Kafka</field>

</fields>

<Member>

<MemberId>MEMBER-001</MemberId>

</Member>

</Record>

Example: completeLoading

Key:

FILE-10001

Headers:

operation=completeLoading

fileId=FILE-10001

groupCustomerNumber=GC-100

Value:

null

Example: Process

Key:

FILE-10001

Headers:

operation=process

fileId=FILE-10001

groupCustomerNumber=GC-100

Value:

null